﻿using Microsoft.Reporting.WebForms;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace YERIL_PI_INT.PaginasWebs.Modulos.Login
{
    public partial class REP_FACTURACION_BY_ORDEN : System.Web.UI.Page
    {
        int cod_orden = 0;

        protected void Page_Load(object sender, EventArgs e)
        {
            cod_orden = Convert.ToInt32(Session["Cod_Orden"]);

            WSGestion.WSGestion wsgest = new WSGestion.WSGestion();
            wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs");

            if (!IsPostBack)
            {
               
                DataTable dt = wsgest.SEL_FACTURACIONByORDEN(cod_orden);
                ReportViewer1.ProcessingMode = ProcessingMode.Local;
                LocalReport localReport = ReportViewer1.LocalReport;

                localReport.ReportPath = "REP_FACTURACION_BY_ORDEN.rdlc";

                ReportDataSource ds = new ReportDataSource();
                ds.Name = "REP_FACTURACION_BY_ORDEN"; // nombre del asistente para informes
                ds.Value = dt;
                ReportViewer1.LocalReport.DataSources.Clear();

              

                localReport.DataSources.Add(ds);

                //DataTable dt1 = wsgest.SEL_FACTURACIONByORDEN(cod_orden);
                //ReportViewer1.ProcessingMode = ProcessingMode.Local;
                //LocalReport localReport1 = ReportViewer1.LocalReport;

                //localReport.ReportPath = "REP_FACTURACION_BY_ORDEN.rdlc";

                //ReportDataSource ds1 = new ReportDataSource();
                //ds1.Name = "RP_DET_MAT_EST_BY_ORDEN"; // nombre del asistente para informes
                //ds1.Value = dt1;




                //localReport1.DataSources.Add(ds1);


            }

        }
    }
}